<?php

class m_url {
	
	
/*------------------------------------------------------------------------------------------------------*/	
		/*
		* Returns an array with the URL segments
		* Note: You must configurate your .htaccess file
		*@author MadPitbull
		
		.htaccess example:
		RewriteEngine On
		RewriteCond %{REQUEST_FILENAME} !/content/*
		RewriteRule .? routing.php
		*/
		public function getSegments() {
			//echo $_SERVER['SCRIPT_NAME'];
	
			$requestURI = explode('/', $_SERVER['REQUEST_URI']);
			$scriptName = explode('/',$_SERVER['SCRIPT_NAME']);
			 
			for($i= 0;$i < sizeof($scriptName);$i++) {
				 if ($requestURI[$i] == $scriptName[$i]){
					unset($requestURI[$i]);
				}
			}
			 
			$command = array_values($requestURI);
			return $command;
		}
	
	
}

